import { Key } from 'react'
export type Status = 0 | 1
export interface IhospitalListParams {
  page: number
  limit: number
  hosname?: string
  hoscode?: string
  hostype?: string
  provinceCode?: string
  cityCode?: string
  districtCode?: string
  status?: Status
}

export interface IhospitalListResItem {
  id: string
  createTime: string
  updateTime: string
  isDeleted: 0
  param: {
    hostypeString: string
    fullAddress: string
  }
  hoscode: string
  hosname: string
  hostype: string
  provinceCode: string
  cityCode: string
  districtCode: string
  address: string
  logoData: string
  intro: string
  route: string
  status: Status
  bookingRule: {
    cycle: number
    releaseTime: string
    stopTime: string
    quitDay: number
    quitTime: string
    rule: string[]
  }
}

export type IhospitalList = IhospitalListResItem[]

export interface IhospitalListResponse {
  totalElements: number
  content: IhospitalList
}

// 省数据对象接口string
export interface Iprovince {
  id: number
  createTime: string
  updateTime: string
  isDeleted: number
  param: object
  parentId: number
  name: string
  value: string
  dictCode: null
  hasChildren: boolean
}

export type IprovinceList = Iprovince[]

export interface Ibr {
  cycle: number
  releaseTime: string
  stopTime: string
  quitDay: number
  quitTime: string
  rule: string[]
}

export interface Ihospital {
  id: string
  createTime: string
  updateTime: string
  isDeleted: number
  param: {
    hostypeString: string
    fullAddress: string
  }
  hoscode: string
  hosname: string
  hostype: string
  provinceCode: string
  cityCode: string
  districtCode: string
  address: string
  logoData: string
  intro: string
  route: string
  status: 0 | 1
  bookingRule: null
}
export interface IhospitalDetailResponse {
  bookingRule: Ibr
  hospital: Ihospital
}

// 医院排班- 科室数据接口
export interface Idep {
  depcode: string
  depname: string
  disabled?: boolean
  children: IdepList
}
export type IdepList = Idep[]

// 医院排班规则上传参数接口
export interface IscheduleRuleParams {
  page: number
  limit: number
  hoscode: string
  depcode: Key
}

// 医院排班规则响应数据的接口
export interface IscheduleRuleResponse {
  total: number
  bookingScheduleList: IbookScheduleList
  baseMap: {
    hosname: string
  }
}

export interface IbookScheduleItem {
  workDate: string
  workDateMd: null
  dayOfWeek: string
  docCount: number
  reservedNumber: number
  availableNumber: number
  status: null
}
export type IbookScheduleList = IbookScheduleItem[]

// 排班列表的接口

export interface IScheduleItem {
  id: string
  createTime: string
  updateTime: string
  isDeleted: number
  param: {
    dayOfWeek: string
    depname: string
    hosname: string
  }
  hoscode: string
  depcode: string
  title: string
  docname: string
  skill: string
  workDate: string
  workTime: number
  reservedNumber: number
  availableNumber: number
  amount: number
  status: number
  hosScheduleId: string
}

export type IScheduleList = IScheduleItem[]
